<!DOCTYPE html>
<html>
<head>
    <title>div测试</title>
    <style type="text/css">
        div {
            display: inline-block;
        }
        .box1{
            width: 300px;
            border:1px red solid;
        }
        .box2{
            width: 300px;
            height: 600px;
            overflow: auto;
            border:1px blue solid;
        }
    </style>
</head>
<body>
<div class="box1">
    <p>sdfsfgdsfgdfgds</p>
</div>
<div class="box2">
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
    <p>sdfsfgdsfgdfgds</p>
</div>
</body>
</html>